function TreeView(){
	 
	var stage = new Kinetic.Stage({
		container: 'container',
        width: 578,
        height: 500
     });
    
	this.layer = new Kinetic.Layer();
	
	// VIEW FUNCTIOM 
	this.view = function(Tree1, xPos, yPos, absAngle){
	 
	 	
	 var toX = 0;
	 var toY = 0;
	 var newAbsAngle = (absAngle+Tree1.angle)%360;
	 
	 if(newAbsAngle<=90){
	 toX = xPos - Math.sin((newAbsAngle/360)*2*Math.PI)*Tree1.height;
	 toY = yPos - Math.cos((newAbsAngle/360)*2*Math.PI)*Tree1.height;	
	 }
	 else{
	 toX = xPos + Math.sin(((360-newAbsAngle)/360)*2*Math.PI)*Tree1.height;
	 toY = yPos - Math.cos(((360-newAbsAngle)/360)*2*Math.PI)*Tree1.height;
	 }
	 this.layer.add(new Kinetic.Line({
        points: [xPos,yPos,toX,toY],
        stroke: 'brown',
        strokeWidth: Tree1.width,
        lineCap: 'round',
        lineJoin: 'round'
      
      }));
    
    
  	
  	 for(var i = 0; i < Tree1.children.length;i++){
			this.view(Tree1.children[i],toX,toY,newAbsAngle);	
		};
	 stage.add(this.layer);
	  
   };
   
   
  	
}
